<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="privilege-item">
    <view class="privilege-item-header">
      <image
        class="privilege-item-bg"
        src="@/package/mall/static/vip-privilege-bg.png"
        mode="widthFix"
      />
      <view class="privilege-item-name">{{ info.big_title }}</view>
    </view>

    <scroll-view
      class="privilege-item-wrapper"
      scroll-y
      enhanced
      :show-scrollbar="false"
    >
      <view class="privilege-item-content">
        <rich-text :nodes="info.big_desc" />
      </view>
    </scroll-view>
  </view>
</template>

<style lang="scss">
.privilege-item {
  position: relative;
  height: 100%;
  padding-top: 160rpx;
  padding-bottom: 70rpx;
  border-radius: 40rpx;
  background-color: #ffffff;
  box-sizing: border-box;

  .privilege-item-header {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .privilege-item-bg {
    display: block;
    width: 100%;
  }

  .privilege-item-name {
    position: absolute;
    left: 30rpx;
    top: 74rpx;
    right: 30rpx;
    font-size: 32rpx;
    color: #795021;
    line-height: 44rpx;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .privilege-item-wrapper {
    position: relative;
    height: 100%;
  }

  .privilege-item-content {
    padding: 30rpx;
    font-size: 28rpx;
    color: #666666;
    line-height: 40rpx;
  }
}
</style>